package com.hbx.gift.fallbcak;

import com.hbx.gift.client.loginUserFeignClient;
import com.hbx.gift.domain.LoginUser;
import com.hbx.gift.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author: hbx
 * @date: 2024/07/20
 **/
@Component
public class LoginUserFallbackFactory implements FallbackFactory<loginUserFeignClient> {
    @Override
    public loginUserFeignClient create(Throwable throwable) {
        return new loginUserFeignClient() {
            @Override
            public AjaxResult addOrUpdate(LoginUser loginUser) {
                return AjaxResult.error("loginUser服务降级");
            }
        };
    }
}
